
<template>
	<view class="cu-bar tabbar bg-white fixedposition">
		<view class="action" @click="navTo(item.pagePath)" v-for="(item,index) in routerList" :key="index">
			<view class="iconfont" :class="current==item.id?`${item.iconPath} text-xm`:item.iconPath"></view>
			<view :class="current==item.id?'text-xm':'text-gray'" class="margin-top-xs">{{item.text}}</view>
		</view>
	</view>	
</template>

<script>
	import {
	    mapState,
	} from 'vuex';
	export default {
		props:{
		  current: {
			type: Number,
			default:1
		  }
		},
		computed:{
			...mapState(['wdnumber','userInfo'])
		},	
		data() {
			return {
				routerList: [{
					'id':1,
					"pagePath": "/pages/index/index",
					"iconPath": "icon-index",
					"text": "首页"
				},{
					'id':2,
					"pagePath": "/pages/find/index",
					"iconPath": "icon-find",
					"text": "发现"
				},{
					'id':3,
					"pagePath": "/pages/person/user",
					"iconPath": "icon-my",
					"text": "我的"
				}],
			};
		},
		mounted() {
		},
		methods: {

			navTo(url){
				uni.reLaunch({
					url:url
				})

			}, 	
		}
	}
</script>

<style>
	.fixedposition{
		box-sizing: border-box;
		position: fixed;
		left: 0;
		bottom: 0;
		width: 100%;
		z-index: 998;
	}
</style>
